﻿Imports System.ComponentModel.DataAnnotations
Imports GerencialSC.Models.Validators

Namespace Models.ViewModels

    Public Class EditFechasAEModel
        <Display(Name:="Año escolar:")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <RegularExpression("^(20)\d{2}$", ErrorMessageResourceName:="Error_Año_OutOfRange", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <UIHint("CIAnio")> _
        Property Anio As Integer

        <Display(Name:="Fecha de Inicio:")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <RegularExpression("^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](201)\d$", ErrorMessageResourceName:="Error_Fechas_DataType", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <IsDate(ErrorMessageResourceName:="Error_Convert_Date", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <UIHint("CFecha")> _
        Property FInicio As String

        <Display(Name:="Fecha de Finalización:")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <RegularExpression("^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](201)\d$", ErrorMessageResourceName:="Error_Fechas_DataType", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <IsDate(ErrorMessageResourceName:="Error_Convert_Date", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <UIHint("CFecha")> _
        <CompareDateMayor("FInicio", "Fecha de Inicio")> _
        Property FFinal As String
    End Class
End Namespace
